package com.dream.dynamic_datasource.controller.login;

import com.dream.dynamic_datasource.dto.UserLoginDto;
import com.dream.dynamic_datasource.entity.user.User;
import com.dream.dynamic_datasource.service.login.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: Luo
 * @create: 2020-07-14 16:19
 */
@RestController
public class LoginController{
    @Autowired
    private LoginService loginService;


    /**
     * 用户登录
     *
     * @param userLoginDto
     * @date 2020/7/14 16:21
     */
    @PostMapping("/login")
    public String login(@RequestBody UserLoginDto userLoginDto) {
        return loginService.login(userLoginDto);
    }
    @GetMapping("/getUser")
    public User getUser() {
        return loginService.getUser();
    }


}
